package com.x.erp.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.x.erp.dao.CountryDao;
import com.x.erp.model.Country;
import com.x.erp.rpc.CountryRpcService;
import com.x.framework.exception.BusinessException;
import com.x.framework.exception.ExceptionCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Service(interfaceName = "com.x.erp.rpc.CountryRpcService", timeout = 60000)
public class CountryService implements CountryRpcService {
	@Autowired
	private CountryDao countryDao;

	@Override
	public List<Country> selectCountryList(Country country) {
		try {
			return countryDao.selectCountryList(country);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0014, e);
		}
	}
}
